package reflect;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

public class Test3 {
    public static void main(String[] args) throws Exception {
        Class c= Person.class;
        Object o = c.newInstance();
        Method[] methods=c.getMethods();
        for(Method method:methods)
        {
            //System.out.println(method.getName());
            boolean b=method.isAnnotationPresent(AutoRunMethod.class);
            if(b)
                method.invoke(o);
        }
    }
}
